<script>
$(function() {
    $('.ghichu').editable('../update_ghichu', {
         id        : 'data[Chamsockenh][id]',
         name      : 'data[Chamsockenh][ghichu]',
         type      : 'textarea',
         cancel    : 'Hủy',
         submit    : 'Lưu',
         tooltip   : 'Click chọn để sửa'
    });
    
});

</script>
<div id="tabs">
	<ul>
        <li><?php echo $this->Html->link(__('Danh sách kênh', true), array('controller' => 'phankenhs', 'action' => 'xemkenhnv',$iddv,$nv_id)); ?> </li>
        <li><?php echo $this->Html->link(__('Công tác điểm bán', true), array('controller' => 'hinhanhdbs', 'action' => 'index',$kenh_id)); ?> </li>
        <li><?php echo $this->Html->link(__('Thông tin thị trường', true), array('controller' => 'thitruongkenhs', 'action' => 'index',$kenh_id)); ?> </li>
        <li id="current"><?php echo $this->Html->link(__('Tần suất chăm sóc', true), array('controller' => 'chamsockenhs', 'action' => 'index',$kenh_id)); ?> </li>
     </ul>  
</div>
<div class="chamsockenhs index">
	<h2><?php echo 'Kênh '.$kenhs[0]['kenhs']['tenkenh'].' - '.$kenhs[0]['kenhs']['diachi'];?></h2>
<div id="accordion">
	<h3 style=" padding:0 0 0em; margin:0;" ><a href="#">TẦN SUẤT CHĂM SÓC</a></h3>
	<div> 
	<table cellpadding="0" cellspacing="0" id="tables">
	<tr>
			<th><?php echo 'STT';?></th>
			<th><?php echo 'Ngày đi';?></th>
			<th><?php echo 'Ghi nhận';?></th>
			<th class="actions"><?php __('Lựa chọn');?></th>
	</tr>
	<?php
	$i = 0;
	foreach ($chamsockenhs as $chamsockenh):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $i; ?>&nbsp;</td>
		<td><?php echo $chamsockenh['Chamsockenh']['ngaydi']; ?>&nbsp;</td>
		<td><div class="ghichu" id="<?php echo $chamsockenh['Chamsockenh']['id']; ?>"><?php echo $chamsockenh['Chamsockenh']['ghichu']; ?></div>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('Xóa', true), array('action' => 'delete', $chamsockenh['Chamsockenh']['id'],$kenh_id), null, sprintf(__('Are you sure you want to delete # %s?', true), $chamsockenh['Chamsockenh']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Trang %page%/%pages%, hiện có %count% mẫu tin', true)
	));
	?>	</p>

	<div class="paging" style="background-color: #FCFDFD;">
		<?php echo $this->Paginator->prev('<< ' . __('Trước', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('Sau', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>
<h3 style=" padding:0 0 0em; margin:0;"><a href="#">CẬP NHẬT THÔNG TIN</a></h3>
	<div>
    <?php echo $this->Form->create('Chamsockenh',array('url'=>'add/'.$kenh_id));?>
	<fieldset>
	<?php
		echo $this->Form->hidden('kenh_id',array('value'=>$kenh_id));
		echo $this->Form->input('ngaydi',array('label'=>'Ngày đi'));
		echo $this->Form->input('ghichu',array('label'=>'Ghi nhận','type'=>'textarea'));
	?>
	</fieldset>
    <?php echo $this->Form->end(__('Lưu', true));?>
    </div>
</div>
</div>
<script>
	$(function() {
		$( "#accordion" ).accordion();
	});
</script>